package Test;

import Test.Bean.MySqlCusConfigBean;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

//相当于这两个@Controller @ResponseBody
@RestController
@Slf4j
public class controller {

    @Autowired
    ApplicationContext appContext;

    @RequestMapping("/h")

    public String hello(){
        MySqlCusConfigBean mySqlConf1 = appContext.getBean(MySqlCusConfigBean.class);
        return mySqlConf1.toString();
    }

}
